var mongoose = require('mongoose');
var mongoosePaginate = require('mongoose-paginate');

var newsSchema = new mongoose.Schema({
    title:String,
    author:String,
    content:String,
    date:{type:Date,default:Date.now},
    newsdate:{type:Date,default:Date.now},
    parentId:String
});

//使用分页插件
newsSchema.plugin(mongoosePaginate);

//将该user模型暴露
module.exports = mongoose.model('News',newsSchema);